Skip to content

bootstrap: Optionally print a backtrace if a command fails#153992

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ferrocene:jyn/bootstrap-backtrace
Mar 20, 2026
Merged

bootstrap: Optionally print a backtrace if a command fails#153992
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ferrocene:jyn/bootstrap-backtrace

Conversation

@jyn514
Copy link
Member

@jyn514 jyn514 commented Mar 17, 2026

I found this quite useful for debugging why a command was failing eagerly (it turns out that .delay_failure() is ignored if fail_fast is enabled).

@jyn514 jyn514 marked this pull request as ready for review March 17, 2026 09:19
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 17, 2026
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks

View changes since this review

@jieyouxu
Copy link
Member

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 17, 2026

📌 Commit e1186d2 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2026
@Kobzol
Copy link
Member

Kobzol commented Mar 17, 2026

@bors r-

(sorry, to ask some questions :) )

With this change, it would print a backtrace even when the failure behavior is Ignore, that doesn't seem like something we want?

Also, bootstrap already prints where was the corresponding command created (file + line) and where was it executed (file + line). But I suppose that it wasn't enough for you and you wanted a full backtrace?

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 17, 2026
@jyn514
Copy link
Member Author

jyn514 commented Mar 17, 2026

With this change, it would print a backtrace even when the failure behavior is Ignore, that doesn't seem like something we want?

correct, yes. I agree this doesn't make a lot of sense, I'll force off backtraces for Ignore.

Also, bootstrap already prints where was the corresponding command created (file + line) and where was it executed (file + line). But I suppose that it wasn't enough for you and you wanted a full backtrace?

Yes. Specifically I was trying to debug the command infra itself, to figure out why an unsuccessful command exited the process instead of delaying the failure until later.

@jieyouxu
Copy link
Member

Hm, I wonder if you are looking for sth more like --verbose-always-print-cmd-backtrace 🤔

@Kobzol
Copy link
Member

Kobzol commented Mar 17, 2026

I think we already have multiple verbosity levels, so maybe we can enable the backtrace only for -vv? That being said, I like the idea of showing the backtrace (regardless of verbosity level) when RUST_BACKTRACE=1 is enabled.

@jyn514 jyn514 force-pushed the jyn/bootstrap-backtrace branch from e1186d2 to c8a2c46 Compare March 18, 2026 10:12
@jyn514
Copy link
Member Author

jyn514 commented Mar 18, 2026

pushed some changes, let me know if they look how you expect :)

@Kobzol
Copy link
Member

Kobzol commented Mar 18, 2026

Looks good, thanks!

@bors r=jieyouxu,kobzol

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 18, 2026

📌 Commit c8a2c46 has been approved by jieyouxu,kobzol

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 18, 2026
… r=jieyouxu,kobzol

bootstrap: Optionally print a backtrace if a command fails

I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-bors bot pushed a commit that referenced this pull request Mar 18, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies)
 - #153557 (fix inference variables leaking into HIR const literal lowering logic)
 - #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint)
 - #153987 (mGCA: Lower const generic args to infer when needed)
 - #153992 (bootstrap: Optionally print a backtrace if a command fails)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 18, 2026
… r=jieyouxu,kobzol

bootstrap: Optionally print a backtrace if a command fails

I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-bors bot pushed a commit that referenced this pull request Mar 19, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153957 (Add bootstrap step for stdarch-verify)
 - #153727 (When single impl can satisfy inference error, suggest type)
 - #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies)
 - #153557 (fix inference variables leaking into HIR const literal lowering logic)
 - #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint)
 - #153987 (mGCA: Lower const generic args to infer when needed)
 - #153992 (bootstrap: Optionally print a backtrace if a command fails)
 - #154036 (borrowck/type_check: remove helper left-over from unsized locals)
 - #154038 (merge `regions-outlives-nominal-type-*` tests into one file)
@JonathanBrouwer
Copy link
Contributor

@bors try jobs=x86_64-gnu-distcheck

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 19, 2026
bootstrap: Optionally print a backtrace if a command fails


try-job: x86_64-gnu-distcheck
@JonathanBrouwer
Copy link
Contributor

@bors r-
#154062 (comment)

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 19, 2026
@jyn514
Copy link
Member Author

jyn514 commented Mar 19, 2026

I don't think this is related to my change. My guess is #153957.

@jyn514
Copy link
Member Author

jyn514 commented Mar 19, 2026

@jyn514
Copy link
Member Author

jyn514 commented Mar 19, 2026

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 19, 2026
@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Mar 19, 2026

Ah right, I followed the backtrace to this PR but that's just because this PR adds the backtrace feature :p
A little bit of a dumb move of me
@bors r=jieyouxu,kobzol

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 19, 2026

📌 Commit c8a2c46 has been approved by jieyouxu,kobzol

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 19, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 19, 2026

☀️ Try build successful (CI)
Build commit: 616883a (616883ab97e2bb9335a3fa226a30e60a28fc426a, parent: 8b86f48958be8c3473c979e0b5504c2d2e0fd4fd)

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 19, 2026
… r=jieyouxu,kobzol

bootstrap: Optionally print a backtrace if a command fails

I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-bors bot pushed a commit that referenced this pull request Mar 19, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153556 (`impl` restriction lowering)
 - #153992 (bootstrap: Optionally print a backtrace if a command fails)
 - #154019 (two smaller feature cleanups)
 - #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
 - #154075 (Rewrite `query_ensure_result`.)
 - #154082 (Updates derive_where and removes workaround)
 - #154084 (Preserve braces around `self` in use tree pretty printing)
 - #154086 (Insert space after float literal ending with `.` in pretty printer)
 - #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
rust-bors bot pushed a commit that referenced this pull request Mar 19, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153556 (`impl` restriction lowering)
 - #153992 (bootstrap: Optionally print a backtrace if a command fails)
 - #154019 (two smaller feature cleanups)
 - #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
 - #154075 (Rewrite `query_ensure_result`.)
 - #154082 (Updates derive_where and removes workaround)
 - #154084 (Preserve braces around `self` in use tree pretty printing)
 - #154086 (Insert space after float literal ending with `.` in pretty printer)
 - #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 19, 2026
… r=jieyouxu,kobzol

bootstrap: Optionally print a backtrace if a command fails

I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 19, 2026
… r=jieyouxu,kobzol

bootstrap: Optionally print a backtrace if a command fails

I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-bors bot pushed a commit that referenced this pull request Mar 20, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #152909 (sess: `-Zbranch-protection` is a target modifier)
 - #153556 (`impl` restriction lowering)
 - #154048 (Don't emit rustdoc `missing_doc_code_examples` lint on impl items)
 - #153992 (bootstrap: Optionally print a backtrace if a command fails)
 - #154019 (two smaller feature cleanups)
 - #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
 - #154075 (Rewrite `query_ensure_result`.)
 - #154082 (Updates derive_where and removes workaround)
 - #154084 (Preserve braces around `self` in use tree pretty printing)
 - #154086 (Insert space after float literal ending with `.` in pretty printer)
 - #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
 - #154109 (tests: Add regression test for async closures involving HRTBs)
rust-bors bot pushed a commit that referenced this pull request Mar 20, 2026
Rollup of 15 pull requests

Successful merges:

 - #152909 (sess: `-Zbranch-protection` is a target modifier)
 - #153556 (`impl` restriction lowering)
 - #154048 (Don't emit rustdoc `missing_doc_code_examples` lint on impl items)
 - #150935 (Introduce #[diagnostic::on_move(message)])
 - #152973 (remove -Csoft-float)
 - #153862 (Rename `cycle_check` to `find_cycle`)
 - #153992 (bootstrap: Optionally print a backtrace if a command fails)
 - #154019 (two smaller feature cleanups)
 - #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
 - #154075 (Rewrite `query_ensure_result`.)
 - #154082 (Updates derive_where and removes workaround)
 - #154084 (Preserve braces around `self` in use tree pretty printing)
 - #154086 (Insert space after float literal ending with `.` in pretty printer)
 - #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
 - #154109 (tests: Add regression test for async closures involving HRTBs)
@rust-bors rust-bors bot merged commit 1f5915e into rust-lang:main Mar 20, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants